package com.hjq.www.View;

import javax.swing.*;
import java.awt.*;

/**
 * Create with IntelliJ IDEA
 *
 * @author: hjq
 * @Date:
 * @Description:
 */
public class InformationView extends JFrame {
    public void init(){
        Container container = getContentPane();
        setBounds(520, 180, 500, 650);
        JButton addButton = new JButton("添加");
        JButton updateButton = new JButton("修改");
        JButton searchButton = new JButton("查询");
        JButton deleteButton = new JButton("删除");
        //添加一块桌布
        container.setLayout(new BorderLayout());
        JLabel idLabel = new JLabel("序    号: ");
        JTextField idField = new JTextField(15);
        JLabel usernameLabel = new JLabel("用 户 名: ");
        JTextField usernameField = new JTextField(15);
        JLabel pwdLabel = new JLabel("密    码: ");
        JTextField pwdField = new JTextField(15);
        JLabel genderLabel = new JLabel("性    别: ");
        JTextField genderField = new JTextField(15);
        JLabel phoneLabel = new JLabel("联系电话: ");
        JTextField phoneField = new JTextField(15);
        JLabel cardLabel = new JLabel("身份证号: ");
        JTextField cardField = new JTextField(15);
        JPanel root = new JPanel();
        root.setLayout(null);
        Font f = new Font("宋体", Font.PLAIN, 25);
        idLabel.setBounds(10,20,130,60);
        idField.setBounds(130,33,280,40);
        usernameLabel.setBounds(10, 100, 130, 60);
        usernameField.setBounds(130, 113, 280, 40);
        pwdLabel.setBounds(10, 180, 130, 60);
        pwdField.setBounds(130, 193, 280, 40);
        genderLabel.setBounds(10, 260, 130, 60);
        genderField.setBounds(130, 273, 280, 40);
        phoneLabel.setBounds(10, 340, 130, 60);
        phoneField.setBounds(130, 353, 280, 40);
        cardLabel.setBounds(10,420,130,60);
        cardField.setBounds(130,432,280,40);
        idLabel.setFont(f);
        usernameLabel.setFont(f);
        pwdLabel.setFont(f);
        genderLabel.setFont(f);
        phoneLabel.setFont(f);
        cardLabel.setFont(f);
        root.add(idLabel);
        root.add(idField);
        root.add(usernameLabel);
        root.add(usernameField);
        root.add(pwdLabel);
        root.add(pwdField);
        root.add(genderLabel);
        root.add(genderField);
        root.add(phoneLabel);
        root.add(phoneField);
        root.add(cardLabel);
        root.add(cardField);
        addButton.setBounds(30,520,80,50);
        updateButton.setBounds(140,520,80,50);
        searchButton.setBounds(250,520,80,50);
        deleteButton.setBounds(360,520,80,50);
        setTitle("饲养员信息操作");
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        root.add(addButton);
        root.add(updateButton);
        root.add(searchButton);
        root.add(deleteButton);
        container.add(root);
        this.setVisible(true);
    }
}
